1. Field of the Invention
The disclosure relates generally to memory management methods and systems, and, more particularly to memory management methods and systems for mobile device that deal with the situation of low memory in accordance with taking good care of user experience.
2. Description of the Related Art
Recently, portable devices, such as handheld devices, have become more and more technically advanced and multifunctional. For example, a handheld device may have telecommunications capabilities, e-mail message capabilities, an advanced address book management system, a media playback system, and various other functions. Due to increased convenience and functions of the devices, these devices have become necessities of life.
As more and more applications become richer and number of published applications grows significantly on a mobile device which is generally coupled with limited physical memory, the situation of Out-Of-Memory (OOM) is met in higher probabilities and needs to be addressed carefully. The modern Operating System (OS) for mobile device monitors memory usage level, and as soon as the level rises above the predefined threshold, the built-in memory management component takes the actions instantly, ex., garbage collection to reclaim unused memory, kill the applications either randomly or based on some simple strategies like application size, application age or creation time.
Some inventions are uncovered to address OOM. U.S. Pat. No. 7,284,099 discloses there is provided a low memory manager allocating part of the memory for specialized applications to be held in reserve. Upon the situation of low memory comes out, reserved chunks of memory are provided to applications first for data backup and remedial steps to be carried out before the affected applications shut down. Multiple memory usage thresholds are presented in U.S. Pat. No. 6,938,254, in which when the first threshold is met, at least one of applications is requested to limit its use of memory. When the second threshold that indicates memory usage is more critical than the first threshold is hit, at least one of applications is notified to close itself. When the third threshold which means memory usage is most critical is seen, a window is prompted for user to choose at least one of applications to terminate. U.S. Pat. No. 7,827,358 prioritizes all running applications statically or dynamically, and once memory usage level goes too high, one or more applications are selected by memory management module based on priorities and come out their memory reduction operations respectively. Then API (Application Programming Interface) is invoked to each selected application to carry out memory reduction operation which could be hide-to-background, freeze-dry, restart, exit gracefully, or else.
However, to select an application to release memory or gracefully shutdown without affecting user feeling significantly is not addressed well in these disclosures. No doubt to pick up applications randomly would fail users' expectation and downgrade user experience. Likewise, pop up a window for users to choose can't deal with the conditions users are not expected being interacting with devices due to sleeping, taking a nap, or putting the device in the pocket at the memory-critical time. To select applications by priorities can't reflect weight of applications to each individual user since the applications user uses frequently are diverse indeed.